package com.dpxm.zdbdg.charte.sand.api;

import com.dpxm.zdbdg.charte.sand.service.ChartPaiLieService;
import com.dpxm.zdbdg.charte.sand.service.ChartSandService;
import com.dpxm.zdbdg.charte.sand.service.HistoryEchartsService;
import com.dpxm.zdbdg.charte.sand.vo.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/sand/chart")
public class QuerySanDApi {
    @Autowired
    private ChartSandService chartSandService;
    @Autowired
    private HistoryEchartsService historyEchartsService;
    @Autowired
    private ChartPaiLieService chartPaiLieService;

    @ApiOperation("3D分析历史数据")
    @PostMapping("/selectSanD/coldHot")
    public SandRes sandResColdHotMessage(  QuerySanDReq req) {
        return chartSandService.coldHot(req);
    }

    /*@ApiOperation("分析数据的奇偶和百位十位个位分析")
    @PostMapping("/selectSanD/coldHot")
    public SandRes sandResOddEvenMessage( QuerySanDReq req) {
        return chartSandService.coldHot(req);
    }*/

    @ApiOperation("3D图表近20期对比历史数据1100期")
    @GetMapping("/selectSanD/contrast")
    public SandEchartsRes sanDHistoryContrastMessage() {
        return historyEchartsService.historyEcharts();
    }

    @ApiOperation("3D图表近50期对比历史数据2500期")
    @GetMapping("/selectSanD/contrast25")
    public SandEchartsRes sanDHistoryContrast25Message() {
        return historyEchartsService.historyEcharts25();
    }

    /**
     * @Description: 3D存最新一期的号码
     * @Param: qihao 期号
     * @Param: nubm 开奖号
     * @Param: testnubm 试机号
     * @Param: createdate 时间
     * @Date: 2022年5月27日16:06:58
     */
    @ApiOperation("3D存最新一期的号码")
    @PostMapping("/saveSanD")
    public String saveSanDMessage(String qihao,String nubm,String testnubm,String createdate) throws Exception {
        return chartSandService.saveSanD(qihao,nubm,testnubm,createdate);
    }

    @ApiOperation("3D查询号码List对象")
    @PostMapping("/selectSanDVO")
    public List<SanDChaiFen> selectSanDVoMessage(String qishu)   {
        return chartSandService.selectSanDVo(qishu);
    }

    @ApiOperation("3D首页柱状图分析")
    @PostMapping("/selectSanDVO/zhuZhunagTu")
    public SandEchartsZhuZhuangRes selectEchZhuZhong(String qishu){
        return historyEchartsService.selectEchartsZhuZhuang(qishu);
    }
    @ApiOperation("排列三存入最新的数据")
    @GetMapping("/savePaiLie")
    public String savePaiLieResMessage() {
        return chartPaiLieService.savePaiLie();
    }

    @ApiOperation("排列三分析历史数据")
    @PostMapping("/selectPaiLie/coldHot")
    public SandRes paiLieResColdHotMessage(@RequestBody QuerySanDReq req) {
        return chartPaiLieService.coldHot(req);
    }
}
